package com.topnav.mc.gbserverapi;

import com.dtflys.forest.annotation.JSONBody;
import com.dtflys.forest.annotation.Post;
import com.dtflys.forest.annotation.Var;
import com.js.lib.result.Result;
import com.topnav.mc.gbserverapi.bean.GbDevice;
import com.topnav.mc.gbserverapi.bean.GbDeviceChannel;
import com.topnav.mc.gbserverapi.bean.UpgradeParam;

import java.util.Map;

/**
 * 与设备相关的API
 * @Author: kenny
 * @Date: 2023/10/26 11:31
 */
public interface DeviceApi {

    @Post(
            value = "{url}/api/subjoin/device/update",
            headers = {"Content-Type : application/json; charset=UTF-8",},
            contentType = "application/json;charset=UTF-8"
    )
    Result updateDevice(
            @Var("url") String url,
            @JSONBody GbDevice gbDevice);

    /**
     * 查设备下的通道列表
     * @param url
     * @param gbDeviceChannel
     * @return
     */
    @Post(
            value = "{url}/api/subjoin/deviceChannel/query/list/where",
            headers = {"Content-Type : application/json; charset=UTF-8",},
            contentType = "application/json;charset=UTF-8"
    )
    Result queryDeviceChannelByDeviceId(
            @Var("url") String url,
            @JSONBody GbDeviceChannel gbDeviceChannel);



    /**
     * 设备固件升级
     * @param url
     * @return
     */
    @Post(
            value = "{url}/api/subjoin/device/firmware/updgrade",
            headers = {"Content-Type :application/json; charset=UTF-8",},
            contentType = "application/json;charset=UTF-8"
    )
    Result deviceFirmwareUpdgrade(
            @Var("url") String url,
            @JSONBody UpgradeParam gbDevice);




}
